<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$col_name}修改</title>
<load href="__PUBLIC__/Js/jquery.js"/>

<link href="__PUBLIC__/Css/green/g_main.css" type="text/css" rel="stylesheet" />
<link href="__PUBLIC__/Css/green/edit.css" type="text/css" rel="stylesheet" />

<script>
function  switch_table(index){
	var group_num="{$group_list|count}";
	for(var i=1;i<=group_num;i++){
	   if(i==index){
		   $("#td_"+i).removeClass();
		   $("#td_"+i).addClass("td_dis");
		   $("#table_"+i).css("display","block");
	   }else{
		   $("#td_"+i).removeClass();
		   $("#td_"+i).addClass("td_undis");
		   $("#table_"+i).css("display","none"); 
	   }
	}
}
</script>

</head>

<body>
<div class="edit">
<div class="title-div"><ul><li class="title">编辑信息</li><li class="back"><a href="javascript:history.go(-1);">[ 后退 ]</a></li></ul></div>
<div class="edittable">

<table border="0" cellpadding="0"  cellspacing="0" id="editarea">
<form id="form2" name="form2" method="post" action="<php>echo U('update',$redirect_param);</php>">

<empty name="group_list">
<php>
foreach($field_name_arr as $k=>$v){
   showformitembyfield($v,$table,"edit",$pk_value);
}  
</php>
<else/>
<tr><td colspan="3">
<ul>
<volist name="group_list" id="vo">
<eq name="i" value="1">
<li class="td_dis"  id="td_{$i}" onclick="switch_table({$i})">{$vo.group_name}</li>
<else/>
<li class="td_undis" onclick="switch_table({$i})" id="td_{$i}">{$vo.group_name}</li>
</eq>
</volist>
</ul>
</td></tr>
<tr><td colspan="3" style="border-bottom:none">
<volist name="group_list" id="vo" key="index">
<eq name="index" value="1">
<table cellpadding="0" cellspacing="0" border="0" id="table_{$index}" >
<else/>
<table cellpadding="0" cellspacing="0" border="0" id="table_{$index}" style="display:none;">
</eq>
<volist name="vo.fields" id="v">
{:showformitembyfield($v,$table,"edit",$pk_value)}
</volist>
</table>
</volist>
</td></tr>
</empty>
<tr><td colspan="3" align="center"><input type="submit" name="btn2" id="btn2" value="修 改"   onclick="return true;this.disabled=true"/>
  <input type="reset" name="btn3" id="btn3" value="返 回"/>
  <input type="hidden" name="{$pk}" id="{$pk}" value="{$pk_value}" /></td></tr>
</form>
</table>

</div>
</div>
<script type="text/javascript">
	var ea = document.getElementById('editarea').getElementsByTagName('tr');
	for(var i=0;i<ea.length;i++){
		ea[i].childNodes[0].style.background = '#EEF8F9';	
	}
	var imga = document.getElementsByTagName('img');
	for(var i=0;i<imga.length;i++){
		if(imga[i].parentNode.nodeName.toLowerCase() == 'a'){
			imga[i].parentNode.style.border= '0px';
			imga[i].parentNode.style.background= '#FFF';
		}
	}
</script>
</body>
</html>
